<% layout("/WEB-INF/view/console/skins/skin_2/layout.html", {}) {
%>
<div class="row">
    <div class="col-md-12">
        <div class="widget-container fluid-height clearfix">
            <div class="widget-content padded clearfix">
                <div class='row'>
                    <div class='col-md-12'>
                        <form name="sysFile_form" id="sysFile_form" class='form-inline'>
                            <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='文件名称'  >文件名称：</label>
 <input  onkeyup='sysFileConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='fileName' name='fileName' placeholder=''>
 </div>
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='文件类型'  >文件类型：</label>
 <input  onkeyup='sysFileConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='fileType' name='fileType' placeholder=''>
 </div>
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='文件高度'  >文件高度：</label>
 <input  onkeyup='sysFileConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='fileHeight' name='fileHeight' placeholder=''>
 </div>
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='文件宽度'  >文件宽度：</label>
 <input  onkeyup='sysFileConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='fileWidth' name='fileWidth' placeholder=''>
 </div>
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='文件大小'  >文件大小：</label>
 <input  onkeyup='sysFileConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='fileSize' name='fileSize' placeholder=''>
 </div>
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='文件地址'  >文件地址：</label>
 <input  onkeyup='sysFileConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='fileUrl' name='fileUrl' placeholder=''>
 </div>
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='是否上传到本地' >是否上传...：</label>
 <select class="form-control" id="local" name="local">
 <option  value="">请选择...</option>
 	<option  value="1">本地</option>
 	<option  value="2">图片服务器</option>
 </select>
 </div>
 
                        </form>
                    </div>
                </div>
                <div class='row'>
                    <div align="center">
                        <button type='button' class='btn btn-default' id='sysFileQuerySearch'>查询</button>
                        <button type='button' class='btn btn-default' id='sysFileReset'>重置</button>
                    </div>
                </div>
                 <div id="sysFileToolbar" class="btn-group">
                              <button type="button" class="btn btn-default" onclick="consoleOpenWindow('sysFile','${ctxPath}/console/sys_file/add','新增')">
                                  <i class="glyphicon glyphicon-plus"></i>
                              </button>
                              <button type="button" class="btn btn-default" onclick='sysFileConsoleGrid.delete("fileId","${ctxPath}/console/sys_file/delete");'>
                                  <i class="glyphicon glyphicon-trash"></i>
                              </button>
                 </div>
                     <div class='row'>
                              <div class='col-md-12'>
                                  <table id="sysFile" data-toggle="table"
                                         data-url="${ctxPath}/console/sys_file/json"
                                         data-pagination="true"
                                         data-query-params="sysFileLoadParam"
                                         method="post"
                                         data-side-pagination="server"
                                         data-show-refresh="true"
                                         data-show-toggle="true"
                                         data-pagination-loop="false"
                                         data-show-columns="true"
                                         data-toolbar="#sysFileToolbar">
                                      <thead>
                                      <tr>
                                           <th data-checkbox="true"></th>
                                            <th data-field='fileId' data-visible='false'>ID</th>
  <th data-sortable='true' data-field='fileName'>文件名称</th>
  <th data-sortable='true' data-field='fileType'>文件类型</th>
  <th data-sortable='true' data-field='fileHeight'>文件高度</th>
  <th data-sortable='true' data-field='fileWidth'>文件宽度</th>
  <th data-sortable='true' data-field='fileSize'>文件大小</th>
  <th data-sortable='true' data-field='fileUrl'>文件地址</th>
  <th data-sortable='true' data-field='createTime'>创建时间</th>
  <th data-field='local' data-sortable='true' data-formatter='sysFilelocalFormatter'>是否上传到本地</th>
  <th data-field='fileId' data-formatter='sysFileTableOperate'>操作</th>
 
                                      </tr>
                                      </thead>
                                  </table>
                              </div>
                     </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
     var sysFileConsoleGrid =new consoleGrid({table_id:"sysFile"});
     sysFileConsoleGrid.init();
     function sysFileTableOperate(value){
         return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindow(\"sysFile\",\"${ctxPath}/console/sys_file/edit?id="+value+"\",\"编辑\")'><span class='glyphicon glyphicon-pencil'></span></button> ";
     }
    function sysFileLoadParam(params){
        params.query=sysFileQueryString();

        return params;
    }
     function sysFileQueryString() {
         var objQuery = new Object();
                objQuery.fileName=$('#fileName').val()==''?null:$('#fileName').val(); 
     objQuery.fileType=$('#fileType').val()==''?null:$('#fileType').val(); 
     objQuery.fileHeight=$('#fileHeight').val()==''?null:$('#fileHeight').val(); 
     objQuery.fileWidth=$('#fileWidth').val()==''?null:$('#fileWidth').val(); 
     objQuery.fileSize=$('#fileSize').val()==''?null:$('#fileSize').val(); 
     objQuery.fileUrl=$('#fileUrl').val()==''?null:$('#fileUrl').val(); 
     objQuery.local=$('#local').val()==''?null:$('#local').val(); 
 
         var queryString = JSON.stringify(objQuery);
         return queryString;
     }

     function sysFilelocalFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case '1': 
       showValue = '本地';
       break;
       case '2': 
       showValue = '图片服务器';
       break;
       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }

 </script>
<%} %>
 